/*
 * Ext JS Library 2.2
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */

Ext.onReady(function(){
		Ext.QuickTips.init();

    // turn on validation errors beside the field globally
    Ext.form.Field.prototype.msgTarget = 'side';

	var loginForm = new Ext.FormPanel({
		id: 'pnlRecover',
	  	renderTo: 'recover-form',
        frame:true,
        title: lbl_title,        
        labelAlign: 'right',  
		height: 130,
        width: 400,
        waitMsgTarget: true,
		layout: 'form',
        items: [{
			xtype: 'fieldset',
            id: 'fsLogin',
			title: lbl_form_title,
			height: 90,
			width: 380,
			labelWidth: 80,
			items:[{
				xtype: 'textfield',
				id: 'email',
                fieldLabel: lbl_email,
                name: 'email',
                vtype:'email',
				width: 200,
                allowBlank:false
            },{
				buttons: [{
					text: btn_recover,
					type: 'submit',
					name: 'login',
					handler: function(){
						var form = loginForm.getForm();
						if(form.isValid()){
							form.submit({url: 'recover', waitMsg: msg_recover, 
										success: function(){
													Ext.Msg.alert(alert_status, alert_msg);				
												 }
										});
						}
					}
        		}]
			}]
		}]
    });
	Ext.getCmp('email').focus();
});
